﻿using M.ShopMachine.Domain;
using M.ShopMachine.Domain.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace M.ShopMachine.Repository.Interface
{
    public interface IDeviceRepository:IRepository<Device>
    {
        Task<Device> GetFormDeviceAsync(int id);
        Task<int> AddDeviceAsync(Device device);
        Task<List<Device>> GetTableDeviceAsync(string? Number, string? Name, bool? State);
        /// <summary>
        /// 车间查看时反填的机床列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<Device>> GetShopMachineAsync(int id);
        /// <summary>
        /// 车间添加修改时添加机床时用的显示机床列表
        /// </summary>
        /// <returns></returns>
        Task<List<Device>> GetShopDeviceAsync(string? Number);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="device"></param>
        /// <returns></returns>
        Task<int> UpdDeviceAsync(Device device);
        /// <summary>
        /// 修改车间机床关系
        /// </summary>
        /// <param name="shop"></param>
        /// <returns></returns>
        Task<int> UpdShopDeviceAsync(int WorkshopId, int[] DeviceIds);
        /// <summary>
        /// 修改状态（停工/恢复）
        /// </summary>
        /// <param name="id"></param>
        /// <param name="State"></param>
        /// <returns></returns>
        Task<int> UpdStateDeviceAsync(int id,bool State);
    }
}
